//
//  IMIMediaPlayer.h
//  MiHome
//
//  Created by 阎超 on 12/05/2017.
//  Copyright © 2017 小米移动软件. All rights reserved.
//

#ifndef IMIMediaPlayer_h
#define IMIMediaPlayer_h

#import "IMIMediaFrameworkBase.h"
#import "IMICodec.h"

@interface IMIMediaPlayer : NSObject

typedef NS_ENUM(NSInteger, IMIMediaPlayerInitType) {
    IMIMediaPlayerInitType_Input = 0,
    IMIMediaPlayerInitType_Output,
};

- (instancetype)initWithFlag:(IMIMediaPlayerInitType)initFlag;
- (instancetype)initWithFlag:(IMIMediaPlayerInitType)initFlag
              withAudioCodec:(IMIFrameDataType)codecFlag
         withAudioSampleRate:(NSInteger)audioSampleRate
      withAudioBitsPerSample:(NSInteger)audioBitsPerSample
            withAuidoChannel:(NSInteger)auidoChannel
               withAuidoGain:(float)auidoGain;
- (void)destory;
- (NSInteger)setDecoderType:(IMIDecoderType)type;
- (NSInteger)inputData:(IMIMediaFrame*)frame;
- (NSInteger)startVideo:(UIView*)renderView withDecodeBlock:(fMediaStreamDataBlock)fDecodeBlock;
- (NSInteger)stopVideo;
- (NSInteger)startAudio:(fMediaStreamDataBlock)fDecodeBlock;
- (NSInteger)stopAudio;
- (NSInteger)play:(UIView*)renderView;
- (NSInteger)prepare;
- (NSInteger)pause;
- (NSInteger)enhanceRender:(IMIEnhanceRenderAlgoType)algoType;
- (UIImage*)snapshotPicture:(void(^)(UIImage* image))finish;
- (NSInteger)startTalk:(fMediaStreamDataBlock)fBlock;
- (NSInteger)stopTalk;
- (NSInteger)getCurrentPosition;

@end

#endif /* IMIMediaPlayer_h */
